package com.atguigu.spring6iocxml.diMap;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestDiMap {

    @Test
    public void testDiMap() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanDiMap.xml");
        Teacher teacher = context.getBean("teacher", Teacher.class);
        teacher.run();
    }

    @Test
    public void testDiMap2() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanDiref.xml");
        Teacher teacher = context.getBean("teacher", Teacher.class);
        teacher.run();
    }

    @Test
    public void testDiMapP() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanDiref.xml");
        Teacher teacher = context.getBean("teacherP", Teacher.class);
        teacher.run();
    }
}
